/*
 * @Author: your name
 * @Date: 2021-08-26 16:44:44
 * @LastEditTime: 2021-08-27 15:52:11
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /index/src/ys/cesium/Building.js
 */
import * as Cesium from "cesium";
/**
 * @description: 影像显示相关的函数
 * @param {*} 
 * @return {*}
 */
function BuildingInit(viewer) {
  this.viewer = viewer
  this.buildingTileset = [];
}

/**
 * @description: 3D title影像加载
 * @param {*}
 * @return {*}
 */
BuildingInit.prototype.Cesium3DTilesetShow = function(url3DTitle) {
  let building001 = this.viewer.scene.primitives.add(
    new Cesium.Cesium3DTileset({
      url: url3DTitle
    })
  );
  this.buildingTileset.push(building001);
}

/**
 * @description: 返回3D title影像对象
 * @param {*}
 * @return {*}
 */
BuildingInit.prototype.ReturnData3DTitle = function() {
  console.log(this.buildingTileset[0]);
  return this.buildingTileset;
}

BuildingInit.prototype.Hidden3DTitleAll = function() {
  console.log();
}

BuildingInit.prototype.Hidden3DTitleIndex = function() {
  console.log(this.buildingTileset[0].show);
  this.buildingTileset[0].show = false;
}



// 加载地形数据
// terrainProvider: new Cesium.CesiumTerrainProvider({
//   url:"http://localhost:8080/cesium_test_dem"
// }),
// terrainExaggeration: 1.3, 


//   // 添加本地建筑模型
//   const building001 = viewer.entities.add({
//     position: Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706),
//     model: {
//       url: "./models/PSFS.glb",
//     },
//   });
//   console.log(viewer.flyTo(building001));
//   // viewer.zoomTo(building001);
//   // viewer.zoomTo(_this.cesiumMap.entities.grass3D);
//   // _this.cesiumMap.entities.buildingModel = true;
//   // console.log(_this.cesiumMap.entities.buildingModel);

export default BuildingInit;